/*
 * Author :pandiam
 */
$.ajaxSetup({ cache: false });

Array.prototype.remove = function (from, to)
{
    var rest = this.slice((to || from) + 1 || this.length);
    this.length = from < 0 ? this.length + from : from;
    return this.push.apply(this, rest);
};

function convert(argument)
{
    if (argument == "") 
        return;
    var lame = argument.split(",");
    for (var j = 0; j < lame.length; j++)
    {
        obj.push(lame[j]);
    }
}

var obj;
if (obj == null) obj = new Array();

function deleteEnt(argument)
{
    obj.remove(argument);
    changeContent();
}

function changeContent()
{
    var deleteLik;
    var htmlCode = "<table>";
    for (var i = 0; i < obj.length; i++)
    {
        deleteLik = "<a href=\"javascript:deleteEnt( " + i + ")\" ><img align=\"center\" height=\"20px\" src=\"images/delete_button.png\" alt=\"delete\"/></a>";
        htmlCode = htmlCode +"<tr><td>"+ obj[i] + "</td><td> " + deleteLik + "</td></tr>" ;
    }
    htmlCode = htmlCode+"</table>";
    $("#visMatrix").html(htmlCode);
}

function passData()
{
    document.deleteEntityForm.data.value = obj;
    document.deleteEntityForm.submit();
}
